package cn.hsw.manage.permission.service;

import cn.hsw.manage.permission.entity.Permission;
import cn.hsw.manage.permission.vo.MenuVo;
import cn.hsw.manage.permission.vo.PermissionDetailVO;
import cn.hsw.manage.permission.vo.PermissionTreeVO;
import cn.hsw.manage.permission.vo.PermissionVO;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Set;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 李子木
 * @since 2021-11-03 08:56:37
 */
public interface PermissionService extends IService<Permission> {

    /**
     * 获取用户接口权限
     * @param userPid 用户主键
     * @return
     */
    Set<String> getPermissionsSet(Long userPid);

    void add(PermissionVO permissionVO);

    void delete(Long pid);

    void edit(Long pid, PermissionVO permissionVO);

    void editState(Long pid, Integer state);

    List<PermissionTreeVO> tree(int type);

    MenuVo menu();

    Permission findByCode(String code);

    PermissionDetailVO findByPid(Long pid);
}
